package com.huaxin.feignclient.file;

import com.huaxin.feignclient.file.models.Base64ImageUploadReqDTO;
import com.huaxin.feignclient.file.models.UploadFIleRespDTO;
import com.huaxin.feignclient.models.ResponseResult;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Component
@FeignClient(name = "file-client", url = "${feignService.files:http://localhost:46831}")
public interface FileClient {

    /**
     * 上传 Base64 图片
     */
    @PostMapping("/v1/files/uploadBase64Image")
    ResponseResult<UploadFIleRespDTO> uploadBase64Image(@RequestBody @Valid Base64ImageUploadReqDTO dto);
}
